//
//  ASUserApi.m
//  AvatarShow
//
//  Created by xunruiIOS on 2021/4/28.
//

#import "ASUserApi.h"

@implementation ASUserApi

/// 意见反馈
/// @param content 反馈内容
/// @param qqStr 联系方式
/// @param completion completion description
/// @param failure failure description
+ (void)feedbackWithContent:(NSString *)content qqStr:(NSString *)qqStr Completion:(void (^)(id  _Nonnull result))completion failure:(void (^)(NSError * _Nonnull error))failure{
    BSDHTTPEntity *entity = [[BSDHTTPEntity alloc]init];
    entity.method = BSDHTTPMethodPOST;
    entity.path = @"feedback/create";
    NSMutableDictionary *parDic = [NSMutableDictionary new];
    [parDic setObject:content?:@"" forKey:@"content"];
    [parDic setObject:qqStr?:@"" forKey:@"contact"];    
    [parDic setObject:[ASTool phoneModel] forKey:@"models"];
    [parDic setObject:[ASTool phoneVersion] forKey:@"system"];
    [parDic setObject:[ASTool networkingStatesFromStatebar] forKey:@"network"];
    [parDic setObject:[ASTool versionNumber] forKey:@"version"];
    [parDic setObject: [ASTool getBundleID]?:@"" forKey:@"package"];

    entity.params = parDic;
    entity.targetClass = [ASBaseModel class];
    [[ASAPIClient sharedClient] requireWithEntity:entity completion:^(id  _Nonnull result) {
        completion(result);
    } failure:^(NSError * _Nonnull error) {
        failure(error);
    }];
}

@end
